export function fishShop(){



world.onPlayerPurchaseSuccess(async({ userId, productId, orderId }) => {
  // 假设玩家购买了ID为[商品id]的商品
  if (productId === 383026458604351) {
    // 由于可能存在多服的情况，每个服都会收到此购买成功的回调，因此需要判断当前服务器有此玩家
    const entity = world.querySelectorAll('player').filter(e => e.player.userId === userId)[0];
    if (entity) {
      // 获得的奖励……
      entity.lingshi += 1;
      entity.player.dialog<GameSelectDialogParams>({
        type: GameDialogType.SELECT,
        title: `小鱼干商城`,
        content: `交易成功！灵石*1已自动放入你的背包！`,
        options: ['好的']
      })
    }
  }else if (productId === 383032129303935) {
    const entity = world.querySelectorAll('player').filter(e => e.player.userId === userId)[0];
    if (entity) {
      entity.lingshi += 8;
      entity.player.dialog<GameSelectDialogParams>({
        type: GameDialogType.SELECT,
        title: `小鱼干商城`,
        content: `交易成功！灵石*8已自动放入你的背包！`,
        options: ['好的']
      })
    }
  }else if (productId === 383026957726407) {
    const entity = world.querySelectorAll('player').filter(e => e.player.userId === userId)[0];
    if (entity) {
      entity.coin += 500;
      entity.player.dialog<GameSelectDialogParams>({
        type: GameDialogType.SELECT,
        title: `小鱼干商城`,
        content: `交易成功！金币*500已自动放入你的背包！`,
        options: ['好的']
      })
    }
  }
});


}